<%@page import="java.text.NumberFormat"%>
<%@page import="java.util.Map"%>
<%@page import="models.DeliveryModel"%>
<%@page import="java.util.TreeMap"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	TreeMap<String, DeliveryModel> listDelivery = (TreeMap<String, DeliveryModel>)request.getAttribute("listDelivery");
	NumberFormat nf = NumberFormat.getInstance();
	String startTime = "";
	String endTime = "";
	if(request.getAttribute("startTime")!=null&&!request.getAttribute("startTime").toString().isEmpty()){
		startTime = (String)request.getAttribute("startTime");
	}
	if(request.getAttribute("endTime")!=null&&!request.getAttribute("endTime").toString().isEmpty()){
		endTime = (String)request.getAttribute("endTime");
	}
%>

<jsp:include page="/admin/layouts/header.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>

<script type="text/javascript">
	jQuery(document).ready(function () {
		jQuery(".leftmenu ul li").removeClass("current");
		jQuery(".leftmenu ul li a.salary").parent().addClass("current");
		
		jQuery("#startTime, #endTime" ).datepicker();	
	});
</script>
        <div class="maincontent noright">
        	<div class="maincontentinner">
            	
                <ul class="maintabmenu">
                	<li class="current"><a href="/admin/dashboard">Bảng lương Giao Nhận</a></li>
                </ul><!--maintabmenu-->
                
                <div class="content">
               		<form class="stdform" action="#" method="post">               		
               		<div class="one_half"> 
               			<p>
                    		<label>Từ ngày : </label>
                             <span class="field"><input type="text" name="startTime" class="longinput" id="startTime" value="<%=(startTime!=null&&!startTime.isEmpty())?startTime:""%>"/></span>                            
                    	</p>   
                    	<p>
                    		<label>Đến ngày : </label>
                             <span class="field"><input type="text" name="endTime" class="longinput" id="endTime" value="<%=(endTime!=null&&!endTime.isEmpty())?endTime:""%>"/></span>                            
                    	</p>
                    	<p class="stdformbutton">
                        	<input type="submit" class="reset radius2" value="Tìm kiếm">
                            <input type="reset" class="reset radius2" value="Làm lại">
                        </p> 
               		</div>     
               		</form>
               		<br clear="all" /><br />                	
               		
                	<div class="contenttitle radiusbottom0">
	                	<h2 class="table"><span>Danh sách GN</span></h2>
	                </div>              
	                
	                <table cellspacing="0" cellpadding="0" border="0" class="stdtable stdtablecb" id="list-table">
	                    <colgroup>
	                        <col class="con0">
	                        <col class="con1">
	                        <col class="con0">
	                    </colgroup>
	                    <thead>
	                        <tr>
	                        	<th class="head0">STT</th>
	                            <th class="head1">Tên GN</th>
	                            <th class="head0">Mã GN</th>
	                            <th class="head1">Địa chỉ</th>
	                            <th class="head0">Đơn hàng</th>
	                            <th class="head1">Tiền công theo ĐC</th>
	                            <th class="head0">Tiền công theo ĐH</th>
	                            <th class="head1">Phụ cấp</th>
	                            <th class="head0">Tổng</th>
	                        </tr>
	                    </thead>
	                    <tfoot>
	                        <th class="head0">STT</th>
                            <th class="head1">Tên GN</th>
                            <th class="head0">Mã GN</th>
                            <th class="head1">Địa chỉ</th>
                            <th class="head0">Đơn hàng</th>
                            <th class="head1">Tiền công theo ĐC</th>
                            <th class="head0">Tiền công theo ĐH</th>
                            <th class="head1">Phụ cấp</th>
                            <th class="head0">Tổng</th>
	                    </tfoot>
	                    <tbody>
	                    	<% int i=1; for (Map.Entry<String, DeliveryModel> entry : listDelivery.entrySet()) { %>
	                        <tr>                        
	                        	<td class="center"><%=i %></td>  	                                	
	                        	<td class="center"><%=entry.getValue().getEmployeeName() %></td>  
	                        	<td class="center"><%=entry.getValue().getEmployeeId() %></td>  	                       
	                        	<td class="center"><%=entry.getValue().getAddress() %></td>  	                       
	                        	<td class="center"><%=entry.getValue().getOrder() %></td>  	                       
	                        	<td class="center"><%=nf.format(entry.getValue().getAddress()*5000) %></td>  	                       
	                        	<td class="center"><%=nf.format(entry.getValue().getOrder()*3000) %></td>  	                       
	                        	<td class="center">1.000.000</td>  	                       
	                        	<td class="center"><%=nf.format(entry.getValue().getAddress()*5000+entry.getValue().getOrder()*3000+1000000) %></td>	                        		                       
	                        </tr>
	                        <% i++; } %>
	                    </tbody>
	                </table>
                </div><!--content-->
                
            </div><!--maincontentinner-->
            
            <jsp:include page="/admin/elements/copyright.jsp">
            	<jsp:param name="language" value="1" />
			</jsp:include>
            
        </div><!--maincontent-->
        
<jsp:include page="/admin/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>